home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
BARNET
/
COMPILER
/
SATHER
/
!Sather
/
Library
/
System
/
sa
/
r_test
next >
Wrap
Text File
|
1996-04-09
|
2KB
|
45 lines
---------------------------> Sather 1.1 source file <--------------------------
-- Copyright (C) International Computer Science Institute, 1995. COPYRIGHT --
-- NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY and is subject --
-- to the terms of the SATHER LIBRARY GENERAL PUBLIC LICENSE contained in --
-- the file "Doc/License" of the Sather distribution. The license is also --
-- available from ICSI, 1947 Center St., Suite 600, Berkeley CA 94704, USA. --
--------> Please email comments to "sather-bugs@icsi.berkeley.edu". <----------
class R_TEST is -- thread safe version of TEST
-- in the sense that more than one thread can call test(),
-- but neither finish nor test_class are thread safe.
-- It is also not possible to instantiate more than
-- one object of this class.
include TEST test->t_test,
unchecked_test->t_unchecked_test,
class_name->t_class_name;
-- actually we should use a MUTEX and the standard lock stmt. But MUTEX
-- is already a very highlevel construct, so we use a low level
-- lock here and are therefor able to test MUTEX too with this classs.
shared lck:LL_LOCK;
test(doc_ds,does_ds,should_ds:$STR) is
-- Perform the test with the description `doc', return value `does',
-- and desired return value `should'. Keep track of failures.
lck.lck;
t_test(doc_ds,does_ds,should_ds);
lck.unlck;
end;
unchecked_test(doc_ds,does_ds,should_ds:$STR) is
-- Perform the test with the description `doc', return value `does',
-- and desired return value `should'. Don't keep track of failures.
lck.lck;
t_unchecked_test(doc_ds,does_ds,should_ds);
lck.unlck;
end;
class_name(nm:STR) is
if void(lck) then lck:=#LL_LOCK; end;
t_class_name(nm);
end;
end;
-------------------------------------------------------------------